<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%
		String path = request.getContextPath();
		String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	%>
	<base href="<%=basePath%>">
    <meta charset="UTF-8">
	<script type="text/javascript" src="jquery1.8/jquery-1.8.0.min.js"></script>
    <title>找回密码</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="Keywords" content="网站关键词">
    <meta name="Description" content="网站介绍">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/reg.css">
    <style>
    	#logo{
    		width: 147px; height: 100px;
    		z-index:999;
			position:fixed; left:0px; top:0px;
    	}
    </style>
</head>
<body>
	<div id="logo">
		<a href="homePage.jsp"><img src="images/bj2.png" /> </a>
	</div>
<div id="ajax-hook"></div>
<div class="wrap">
    <div class="wpn">
        <div class="form-data find_password" style="height: 250px;">
            <h4>找回密码</h4>
            <p class="right_now">已有账号，<a href="./index.jsp">马上登录</a></p>
            <p class="p-input pos">
                <label for="pc_tel">请输入新密码</label>
                <input type="password" id="pc_tel">
                <span class="tel-warn pc_tel-err hide"><em>最多五个字</em><i class="icon-warn"></i></span>
            </p>
            <p class="p-input pos">
                <label for="veri-code">确认密码</label>
                <input type="password" id="veri-code">
                <span class="tel-warn" style="display: none;" id="new"><em>两次密码不一致！</em><i class="icon-warn"></i></span>
            </p>
          
            <input type="button" onclick="ok()" class="lang-btn" value="确认" style="margin-top: 230px;margin-left: 61px;"/>
            <p class="right">Powered by © 2018</p>
        </div>
    </div>
</div>
<script src="./js/jquery2.js"></script>
<script src="./js/agree.js"></script>
<script src="./js/reset.js"></script>
<script type="text/javascript">
function ok(){
	$.ajax({
		data:{"newPassword":$("#pc_tel").val(),"tooPassword":$("#veri-code").val()},
		type:"post",
		url:"updatePassword.do",
		dataType:"json",
		success:function(data){
			if(data.result==true){
				$("#new").css("display","none");
				alert("修改成功！");
				location.href="<%=basePath%>index.jsp";
			}else{
				$("#new").css("display","block");
			}
		},
		error:function(){
			alert("失败!");
		}
	});
}
</script>
</body>
</html>